package com.qunar.itts.validator.hibernate;

import java.util.Date;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Past;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import org.hibernate.validator.constraints.Email;

import com.qunar.itts.validator.EnumConstants.NextStepType;
import com.qunar.itts.validator.EnumConstants.RuleType;
import com.qunar.itts.validator.annotation.ConclusionRule;
import com.qunar.itts.validator.annotation.LogicRule;
import com.qunar.itts.validator.annotation.Rules;

public class InfoBean 
{
	/*@NotNull(message = "姓名不能为空!")
	@Min(value = 1, message = "Id只能大于等于1，小于等于10")
	@Max(value = 10, message = "Id只能大于等于1，小于等于10")
	private Integer id;*/
	
	@NotNull(message = "姓名不能为空!")
	@Size(min = 2, max = 4, message = "姓名长度必须在{min}和{max}之间")
	@Pattern(regexp = "[\u4e00-\u9fa5]+", message = "名称只能输入是中文字符")
	private String userName;
	
	@Rules(
			conclusionList = {
					@ConclusionRule(id = "A",type = RuleType.string_regex, value = "[\u4e00-\u9fa5]+", tip = "必须为汉字")
			},
			logicList = {
					@LogicRule(conclusion = "A",successNextStep = NextStepType.returnSuccess)
					},
			text = "密码")
	private String passWord;
	
/*	@NotNull(message = "日期不能为空!")
	@Past(message = "你只能输入过去的提起") 
	private Date birthday;
	
	@NotNull(message = "邮件不能为空!")
	@Email(message = "邮件格式不正确")
	private String email;*/


	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getPassWord() {
		return passWord;
	}

	public void setPassWord(String passWord) {
		this.passWord = passWord;
	}

}